package com.device.search.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.device.search.dao.NodesDAO;

public interface NodesMapper {

	@Select("SELECT n.* FROM nodes n,construction_basic b,construction_device d " + 
			"WHERE n.device_name=d.dvice_no AND b.id=d.construction_id AND b.project_name LIKE CONCAT(CONCAT('%',#{projectName},'%')) AND d.dvice_no LIKE CONCAT(CONCAT('%',#{deviceNo},'%')) ORDER BY n.updated_at DESC LIMIT 10;")
	List<NodesDAO> findByProjectNameAndDeviceNo(@Param("projectName") String projectName, @Param("deviceNo") String deviceNo);

}
